//package com.amumu.drama.portal.controller;
//
//import com.amumu.drama.common.api.CommonResult;
//import com.amumu.drama.common.modules.order.service.UmsMemberReceiveAddressService;
//import com.amumu.drama.model.UmsMemberReceiveAddress;
//import com.amumu.drama.portal.service.AuthService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * 会员收货地址管理Controller
// * Created by macro on 2018/8/28.
// */
//@Controller
//@Api(tags = "UmsMemberReceiveAddressController")
//@Tag(name = "UmsMemberReceiveAddressController", description = "会员收货地址管理")
//@RequestMapping("/member/address")
//public class UmsMemberReceiveAddressController {
//    @Autowired
//    private UmsMemberReceiveAddressService memberReceiveAddressService;
//
//    @Autowired
//    private AuthService authService;
//
//    @ApiOperation("添加收货地址")
//    @RequestMapping(value = "/add", method = RequestMethod.POST)
//    @ResponseBody
//    public CommonResult add(@RequestBody UmsMemberReceiveAddress address) {
//        int count = memberReceiveAddressService.add(address,authService.getCurrentMember());
//        if (count > 0) {
//            return CommonResult.success(count);
//        }
//        return CommonResult.failed();
//    }
//
//    @ApiOperation("删除收货地址")
//    @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
//    @ResponseBody
//    public CommonResult delete(@PathVariable Long id) {
//        int count = memberReceiveAddressService.delete(id,authService.getCurrentMember());
//        if (count > 0) {
//            return CommonResult.success(count);
//        }
//        return CommonResult.failed();
//    }
//
//    @ApiOperation("修改收货地址")
//    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
//    @ResponseBody
//    public CommonResult update(@PathVariable Long id, @RequestBody UmsMemberReceiveAddress address) {
//        int count = memberReceiveAddressService.update(id, address,authService.getCurrentMember());
//        if (count > 0) {
//            return CommonResult.success(count);
//        }
//        return CommonResult.failed();
//    }
//
//    @ApiOperation("获取所有收货地址")
//    @RequestMapping(value = "/list", method = RequestMethod.GET)
//    @ResponseBody
//    public CommonResult<List<UmsMemberReceiveAddress>> list() {
//        List<UmsMemberReceiveAddress> addressList = memberReceiveAddressService.list(authService.getCurrentMember());
//        return CommonResult.success(addressList);
//    }
//
//    @ApiOperation("获取收货地址详情")
//    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
//    @ResponseBody
//    public CommonResult<UmsMemberReceiveAddress> getItem(@PathVariable Long id) {
//        UmsMemberReceiveAddress address = memberReceiveAddressService.getItem(id,authService.getCurrentMember());
//        return CommonResult.success(address);
//    }
//}
